﻿<%@ Page Title="TSQP" Language="C#" MasterPageFile="~/main/masterpage/main_level1.Master"
    AutoEventWireup="true" CodeBehind="quanhuyen.aspx.cs" Inherits="nkstdgia.main.quanhuyen" %>

<%@ Register Assembly="wsRK.wsControls" Namespace="wsRK.wsControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phd_content" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table width="100%">
                <tr>
                    <th style="width: 50%">
                        <div class="webapplication_form_header">
                            <div class="left">
                                <h1>
                                    <asp:Label ID="lblTitle" runat="server">Quận</asp:Label>
                                </h1>
                            </div>
                        </div>
                    </th>
                    <th style="width: 50%">
                        <div class="webapplication_form_header">
                            <div class="left">
                                <h1>
                                    <asp:Label ID="Label5" runat="server">Phường</asp:Label>
                                </h1>
                            </div>
                        </div>
                    </th>
                </tr>
                <tr>
                    <td style="vertical-align: top; padding-right: 5px">
                        <div class="action_bar">
                            <div class="right ">
                                <cc1:wsBtnAction ID="btnAddQuan" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                                    OnClientClick="javascript:Main.openPopup('system_popup1');"></cc1:wsBtnAction>
                            </div>
                        </div>
                        <asp:ListView ID="lvQuan" runat="server" DataKeyNames="MA_THAM_SO" OnItemCommand="lvQuan_ItemCommand"
                            OnSelectedIndexChanging="lvQuan_SelectedIndexChanging" OnItemEditing="lvQuan_ItemEditing"
                            OnItemCanceling="lvQuan_ItemCanceling" OnItemUpdating="lvQuan_ItemUpdating">
                            <LayoutTemplate>
                                <table class="data_table">
                                    <tr>
                                        <th>
                                            Tên
                                        </th>
                                        <th style="width: 50px">
                                            Thứ tự
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <div class="left">
                                            <asp:LinkButton ID="lbtnTenQuan" runat="server" Text='<%# Eval("NOI_DUNG") %>' CommandName="Select"
                                                CommandArgument='<%# Eval("MA_THAM_SO") %>'></asp:LinkButton>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeleteQuan" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <tr class="altrow">
                                    <td>
                                        <div class="left">
                                            <asp:LinkButton ID="lbtnTenQuan" runat="server" Text='<%# Eval("NOI_DUNG") %>' CommandName="Select"
                                                CommandArgument='<%# Eval("MA_THAM_SO") %>'></asp:LinkButton>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeleteQuan" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr>
                                    <td>
                                        <div class="left" style="width: 100px">
                                            <asp:TextBox ID="txtTenQuan" runat="server" Text='<%# Eval("NOI_DUNG") %>'></asp:TextBox>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" CommandName="Update">Lưu</asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton2" CssClass="button_submit" runat="server" CommandName="Cancel">Hủy bỏ</asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <cc1:wsTxtInterger ID="txtThuTu" runat="server" Text='<%# Eval("SEQUENCE") %>'></cc1:wsTxtInterger>
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #cacaca">
                                    <td>
                                        <div class="left">
                                            <asp:Label ID="lblTenQuan" runat="server" Text='<%# Eval("NOI_DUNG") %>'></asp:Label>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeleteQuan" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>
                            <EmptyDataTemplate>
                                <table class="data_table">
                                    <tr>
                                        <th>
                                            Tên
                                        </th>
                                        <th style="width: 50px">
                                            Thứ tự
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" Text="" />
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:ListView>
                    </td>
                    <td style="vertical-align: top; padding-left: 5px">
                        <div class="action_bar">
                            <div class="right ">
                                <cc1:wsBtnAction ID="btnAddHuyen" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                                    OnClientClick="javascript:Main.openPopup('system_popup2');"></cc1:wsBtnAction>
                            </div>
                        </div>
                        <asp:ListView ID="lvPhuong" runat="server" OnItemCanceling="lvPhuong_ItemCanceling"
                            OnItemCommand="lvPhuong_ItemCommand" OnItemEditing="lvPhuong_ItemEditing" OnItemUpdating="lvPhuong_ItemUpdating"
                            OnSelectedIndexChanging="lvPhuong_SelectedIndexChanging">
                            <LayoutTemplate>
                                <table class="data_table">
                                    <tr>
                                        <th>
                                            Tên
                                        </th>
                                        <th style="width: 50px">
                                            Thứ tự
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </LayoutTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <div class="left">
                                            <asp:Label ID="lbtnPhuong" runat="server" Text='<%# Eval("NOI_DUNG") %>'></asp:Label></div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeletePhuong" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <tr class="altrow">
                                    <td>
                                        <div class="left">
                                            <asp:Label ID="lbtnPhuong" runat="server" Text='<%# Eval("NOI_DUNG") %>'></asp:Label></div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeletePhuong" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label ID="Label7" runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </AlternatingItemTemplate>
                            <EditItemTemplate>
                                <tr>
                                    <td>
                                        <div class="left" style="width: 100px">
                                            <asp:TextBox ID="txtTenPhuong" runat="server" Text='<%# Eval("NOI_DUNG") %>'></asp:TextBox>
                                            <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" CommandName="Update">Lưu</asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton2" CssClass="button_submit" runat="server" CommandName="Cancel">Hủy bỏ</asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <cc1:wsTxtInterger ID="txtThuTu" runat="server" Text='<%# Eval("SEQUENCE") %>'></cc1:wsTxtInterger>
                                    </td>
                                </tr>
                            </EditItemTemplate>
                            <SelectedItemTemplate>
                                <tr style="background-color: #cacaca">
                                    <td>
                                        <div class="left">
                                            <asp:LinkButton ID="LinkButton4" runat="server" Text='<%# Eval("NOI_DUNG") %>' CommandName="Select"
                                                CommandArgument='<%# Eval("MA_THAM_SO") %>'></asp:LinkButton><asp:HiddenField ID="hfID"
                                                    runat="server" Value='<%# Eval("MA_THAM_SO") %>' />
                                        </div>
                                        <div class="right">
                                            <asp:LinkButton ID="LinkButton1" CssClass="button_submit" runat="server" Text="Sửa"
                                                CommandName="Edit"></asp:LinkButton>
                                            <asp:LinkButton ID="LinkButton3" CssClass="button_submit" runat="server" Text="Xóa"
                                                CommandName="DeletePhuong" CommandArgument='<%# Eval("MA_THAM_SO") %>' OnClientClick="javascript: return confirm('Bạn có chắc muốn xóa?');"></asp:LinkButton>
                                        </div>
                                    </td>
                                    <td>
                                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("SEQUENCE") %>' />
                                    </td>
                                </tr>
                            </SelectedItemTemplate>
                            <EmptyDataTemplate>
                                <table class="data_table">
                                    <tr>
                                        <th>
                                            Tên
                                        </th>
                                        <th style="width: 50px">
                                            Thứ tự
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="Label1" runat="server" Text="" />
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:ListView>
                    </td>
                </tr>
            </table>
            <div id="system_popup1">
                <div class="action_bar" style="margin-left: 5px">
                    <div class="right ">
                        <cc1:wsBtnAction ID="btnAddQuanPopup" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                            OnClick="btnAddQuanPopup_Click" ValidationGroup="AddQuan"></cc1:wsBtnAction>
                    </div>
                </div>
                <table class="option_table">
                    <tr>
                        <td class="option_table_td_100">
                            <asp:Label ID="lblName" runat="server">Tên quận</asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenQuanPopup" runat="server" MaxLength="100"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                ValidationGroup="AddQuan" ControlToValidate="txtTenQuanPopup">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="">
                            <asp:Label ID="lblDescription" runat="server">Thứ tự hiển thị</asp:Label>
                        </td>
                        <td>
                            <cc1:wsTxtInterger ID="txtThuTuQuan" runat="server">0</cc1:wsTxtInterger>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="system_popup2">
                <div class="action_bar" style="margin-left: 5px">
                    <div class="right ">
                        <cc1:wsBtnAction ID="btnAddPhuongPopup" runat="server" LocaleText="Add" ButtonType="ButtonAdd"
                            OnClick="btnAddPhuongPopup_Click" ValidationGroup="AddPhuong"></cc1:wsBtnAction>
                    </div>
                </div>
                <table class="option_table">
                    <tr>
                        <td class="option_table_td_100">
                            <asp:Label ID="Label2" runat="server">Tên phường</asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtTenPhuong" runat="server" MaxLength="100"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                ValidationGroup="AddPhuong" ControlToValidate="txtTenPhuong">*</asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class="">
                            <asp:Label ID="Label3" runat="server">Thứ tự hiển thị</asp:Label>
                        </td>
                        <td>
                            <cc1:wsTxtInterger ID="txtThuTuPhuong" runat="server">0</cc1:wsTxtInterger>
                        </td>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phd_footer" runat="server">
</asp:Content>